package user.Model.service;

import user.Model.dao.dao;
import user.Model.entity.book;
import user.Model.entity.record;

import java.util.ArrayList;

public class Service {
    //修改个人信息
    public static int changeUserInformation(int id, String username, String password, String postbox, String phoneNumber, String name, String direction, String phase) throws Exception {
        return dao.changeUserInformation(id, username, password, postbox, phoneNumber, name, direction, phase);
    }
    //获取id
    public static int getId(String username)throws Exception{
        return dao.getId(username);
    }
    public static ArrayList<book> searchBooKind(String kind) throws Exception {
        return dao.searchBookKind(kind);
    }
    public static int borrowBook(String bookName) throws Exception {
        return dao.borrowBook(bookName);
    }
    public static int returnBook(String bookName) throws Exception{
        return dao.returnBook(bookName);
    }
    public static ArrayList<book> searchBook(String bookInformation) throws Exception{
        return dao.searchBook(bookInformation);
    }
    public static ArrayList<record> getBorrowBookRecord() throws Exception {
        return dao.getBorrowBookRecord();
    }
}